package com.ming.elm.service.impl;

import java.util.ArrayList;
import java.util.List;

import com.ming.elm.dao.FoodDao;
import com.ming.elm.po.Food;
import com.ming.elm.service.FoodService;
import com.ming.elm.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;

public class FoodServiceImpl implements FoodService{

		// 根据商家Id查询该商家的商品信息
		@Override
		public List<Food> listFoodByBusinessId(Integer businessId) {
			List<Food> foods = null;
			SqlSession sqlSession = MybatisUtil.getSqlSession();
			FoodDao mapper = sqlSession.getMapper(FoodDao.class);
			try {
				foods = mapper.listFoodByBusinessId(businessId);
			} catch (Exception e) {
				e.printStackTrace();
			}

			return foods;
	}
}
